package org.bbl.db.mybatis.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import org.bbl.db.domain.WordList;

import java.util.List;

/**
 * @author biniamg
 * @since 1/8/13
 */
public interface WordListMapper extends BaseMapper<WordList> {

    @Select("SELECT * FROM WORDLIST WHERE languageId = #{param1} AND word like #{param2}")
    List<WordList> findByParentId(int param1, String param2, RowBounds rowBounds);

    @Delete("DELETE FROM WORDLIST WHERE languageId = #{param1}")
    void delete(int param1);

    @Insert("INSERT INTO WORDLIST (languageId,word,frequency) VALUES" +
            "(#{languageId}," +
            "#{word}," +
            "#{frequency})")
    void insert(WordList wordList);
}
